import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium'
import legacy from '@vitejs/plugin-legacy';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      reactivityTransform:true
    }),
    cesium({
      rebuildCesium:true
    }),
    // legacy({
    //   targets:['defaults','not IE 11']
    // })
  ],
  base: './',
  outDir: 'dist',
  server: {
    open: true,
    port: 3333,
    https: false,
    ssr:false,
    proxy: {
      '/api': {
        target: 'http://www.yugaosu.com:18081/zlgs',
        changeOrigin: true,
        rewrite:(path)=>path.replace(/^\/api/,'')
      }
    }
  },
  build: {
    outDir: './dist',
    target: 'modules',
    assetsDir: 'assets',
    assetsInlineLimit:360000,
  },
  devServer: {
    host: 'localhost',
    port: 3303,
    overlay:false
  }
})
